<?php

  function all_file_system($directory='.', $regex=false) {
    $array_items = array();
    if ($handle = opendir($directory)) {
      while (false !== ($tmpfile = readdir($handle))) {
	if ($tmpfile != "." && $tmpfile != "..") {
	  if (is_dir($directory. "/" . $tmpfile)) {
	    $array_items = array_merge($array_items, $this->all_file_system($directory. "/" . $tmpfile, $regex));
	    $tmpfile = $directory . "/" . $tmpfile;
	    $array_items[] = preg_replace("/\/+/si", "/", $tmpfile);
	  } else {
	    $tmpfile = $directory . "/" . $tmpfile;
	    $array_items[] = preg_replace("/\/+/si", "/", $tmpfile);
	  }
	}
      }
	closedir($handle);
      }
      unset($handle);
      unset($tmpfile);
      if($regex){
	foreach($array_items as $key=>$val){
	  if(!preg_match('/'.$regex.'/',$val)){
	    unset($array_items[$key]);
	  }
	}
      }
      return $array_items;
  }

header('Content-type: text/plain');

//print nl2br(join("\n", all_file_system('.', 'php.ini|empty.txt'), ) );

// passthru(' grep eval `find . -type f -name \*.php`');

passthru(' grep -P \'eval.*(gz(uncompress|inflate)|str_rot13|base64_decode)\' `find . -type f -name \*.php`');

passthru(' grep -P \'(system|exec|shell_exec|passthru)\s*\(.*(SERVER|wget|lynx|curl|cd)\' `find . -type f -name \*.php`') ;

